<?php

namespace app\admin\validate;

use think\Validate;
use app\common\Error;

class Applet extends Validate
{
    protected $rule = [
        'id' => 'require',
        'name' => 'require',
        'app_id' => 'require',
        'app_secret' => 'require',
        'type' => 'require',
        'status' => 'require',
        'url' => 'require',
    ];

    protected $message = [
        'id.require' => Error::ID_NOT_EXIXTS,
        'name.require' => Error::NAME_NOT_EXIXTS,
        'app_id.require' => Error::APP_ID_NOT_EXIXTS,
        'app_secret.require' => Error::APP_SECRET_NOT_EXIXTS,
        'type.require' => Error::TYPE_NOT_EXIXTS,
        'status.require' => Error::STATUS_NOT_EXIXTS,
        'url.require' => Error::URL_NOT_EXIXTS,
    ];

    protected $scene = [
        'add' => ['name', 'app_id', 'app_secret', 'status', 'url', 'type'],
        'edit' => ['id', 'name', 'app_id', 'appsecret', 'status', 'url', 'type'],
        'delete' => ['id'],
        'detail' => ['id'],
    ];
}